import { review } from '@/api/train'
const state = {
  lessonId: '' ,//课程id
  reviewCoachList:[],
  reviewAthleteList:[],
  lessonInfo:{},
  rollCall:0,
}

const mutations = {
  GET_REVIEWLIST: (state, info ) => {
	state.rollCall = info.rollCall==='YES'
    state.reviewAthleteList = info.athleteList //审阅签到信息 运动员
	state.reviewCoachList = info.coachList //审阅签到信息 教练
	state.lessonInfo = info.lesson
	console.log('infoinfo',info)
  },
  
}

const actions = {
  lessonId(obj){
		return obj
  },
  //日程教练
  reviewList({
    commit,
    state
  }, info) {
    console.log(state, info)
	this._vm.$ajax.post('/roll_call/review',{ params: info},(response) => {
		const data = response
		console.log(21312,response.status===0,review)
		if(response.status===0) {
		commit('GET_REVIEWLIST', data.result)
		}else{
		commit('GET_REVIEWLIST', review.result)
		}
		},() => {
		commit('GET_REVIEWLIST', review.result)
		})
  }
  //日程运动员
  
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
